<%@page import="org.swim.sessions.GestoreRicercaRemote"%>
<%@page import="org.swim.entity.Utente"%>
<%@page import="org.swim.sessions.GestoreUtentiRemote"%>
<%@page import="javax.naming.*"%>
<%@page import="java.util.*"%>
<%@ page language="java" contentType="text/plain; charset=UTF-8" pageEncoding="UTF-8"%><%

Hashtable<String,String> env = new Hashtable<String,String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL,"localhost:1099"); 
InitialContext ctx = new InitialContext(env); 
GestoreRicercaRemote gestore = (GestoreRicercaRemote)ctx.lookup("GestoreRicerca/remote");

String abilita = request.getParameter("abilita");

List<Utente> l = gestore.ricercaSemplice(abilita);
Boolean virgola = false;
%>{
"results":
	[<%for(Utente u: l){%>
	<%if(virgola)%>,<%;%>
	{"nome":"<%out.print(u.getNome());
	%>","cognome":"<%out.print(u.getCognome());
	%>"}<%
	virgola= true;}%>
	]
}